Conventionally, a main center, which performs tasks by using databases (DBs), replicates these databases at a remote backup center in preparation for a disaster or the like. The main center includes multiple master DBs and the backup center includes replica DBs that are associated with the master DBs. The main center synchronizes the master DBs with the replica DBs.
If master DBs retained at a main center are updated, a system that replicates the DBs and performs synchronization transfers an update difference result (hereinafter, referred to as a journal) for each master DB to the backup center in real time. The backup center reflects, in each replica DB as a single transaction, the journal received from the main center. In this way, the main center synchronizes the master DBs with the replica DBs. If a disaster occurs in the main center, tasks are resumed at the backup center.
A commonly performed task of the main center is to update multiple master DBs in a single transaction, and this transaction maintains the consistency with each master DB. As a technology for maintaining the consistency of each replica DB at a backup center, there is a known technology for accumulating journals in a temporary file and temporarily suspending the reflecting of a journal in the replica DB.
In the following, as an example, a description will be given in which a main system is used that includes a master DB (A) and a master DB (B) and a backup center is used that includes a replica DB (C), which is a replica DB of the master DB (A), and a replica DB (D), which is a replica DB of the master DB (B).
The main center transmits, to the backup center, a transaction 1, a transaction 2, a transaction 3, and a transaction 4 as a first generation journal file for the replica DB (C). Similarly, the main center transmits, to the backup center, the transaction 1 and the transaction 2 as a first generation journal file for the replica DB (D). Each transaction is a process for reflecting a journal in a DB.
The backup center specifies that the transaction 1 and the transaction 2 are contained in the journal with respect to each replica DB. Specifically, the backup center specifies that the journals of the transaction 1 and the transaction 2 are both sent to each of the replica DBs. Accordingly, the backup center executes the transaction 1 and the transaction 2 on the replica DB (C) and the replica DB (D) and the update results are reflected. Then, the backup center retains the transaction 3 and the transaction 4 as a takeover file for the replica DB (C) and suspends the reflection until the backup center receives the next generation journal.
Thereafter, the main center transmits, as a second journal file for the replica DB (C), a transaction 5 and a transaction 6 to the backup center. Similarly, the main center transmits, as a second journal file for the replica DB (D), the transaction 3 to the backup center.
Then, the backup center specifies that the journal of the transaction 3 is present in the takeover file for the replica DB (C) and that the transaction 3 for the replica DB (D) is received at the second generation. Specifically, the backup center specifies that the journal of the transaction 3 is sent to both replica DBs. Accordingly, the backup center executes the transaction 3, which is retained in the takeover file, on the replica DB (C) so that an update result is reflected therein and executes the transaction 3, which is received at the second generation, on the replica DB (D) to reflect an update result.
Then, the backup center retains, as a takeover file, the transaction 5 and the transaction 6 for the replica DB (C) received at the second generation and suspends the reflection until the next generation journal is received. Specifically, the backup center retains, as the take over files for the replica DB (C), the journals of the transaction 4, the transaction 5, and the transaction 6.
Patent Document 1: Japanese Laid-open Patent Publication No. 2007-317040
Patent Document 2: Japanese Laid-open Patent Publication No. 2006-18796
Patent Document 3: Japanese Laid-open Patent Publication No. 2006-92005
However, there is a problem in that it takes a long time to reflect data in a replica DB and it also takes a long time to resume the operation after a problem occurs.
In conventional technology, after grasping the status of transferring a journal to the backup center, the consistency of transactions is checked and then reflection is performed. Furthermore, the main center asynchronously transmits journals between generations. Accordingly, for a journal that is retained in a takeover file until the next generation journal is received, it is not possible to estimate the time at which the reflection will be executed; therefore, there may be a case in which reflection is suspended for quite a long time. As described above, it sometimes takes a long time to reflect data in a replica DB.
Furthermore, a takeover file retains therein, for each replica DB, a journal in which reflection is being suspended. Accordingly, if a problem occurs in the main system, the latest state of each master DB in the main system is specified from the journal that is being suspended. Therefore, if a problem occurs in the main system in a state in which a takeover file retains a lot of journals, it takes a long time to grasp the latest state of each master DB. Furthermore, thereafter, a journal is reflected in each replica DB such that each replica DB becomes the latest state of the master DB, and thus it takes a long time to resume the operation after a problem occurs. Furthermore, if all journals are reflected, because there may be a case in which the replica DBs are inconsistent, it takes a long time to specify, from among suspended journals, the maximum number of journals that can be reflected. As described above, it is hard to say that the time taken to resume the operation after a problem occurs is short.